// 引入mongoose接口
const mongoose = require("mongoose");

require("../db/model/seats")

mongoose.connect(
    "mongodb://tangzhenhua:Lovo123456@182.92.214.223:8084/maiwenjie",
    {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        auth: { authSource: "admin" }
    },
    async () => {
        // 614f5a7c0747b95bec04d4cc
        const seatsModel = mongoose.model("seats");
        const seatsArr = []
        for(let i = 1; i <=9; i++) {
            for(let j = 1; j <=9; j++) {
                seatsArr.push({
                    displayName: `${i}排${j}列`,
                    theaterId: "615006d37170f32bc852fc2f"
                })
            }
        }
        const data = await seatsModel.create(seatsArr)
    }
);